Skip to content

RDKEMW-22317 : Integrate VIPA widget 1.4.4.5 with nativescript - #138

Open
gurpreet319 wants to merge 2 commits into
developfrom
topic/RDKEMW-22317
Open

RDKEMW-22317 : Integrate VIPA widget 1.4.4.5 with nativescript#138
gurpreet319 wants to merge 2 commits into
developfrom
topic/RDKEMW-22317

Conversation

@gurpreet319

Copy link
Copy Markdown
Contributor

Reason for change: Integrate VIPA 1.4.4.5 with nativescript, updated the xhr and URLSearchParams.
Test Procedure: build should be successful
Risk: low
Priority: P2

Copilot AI review requested due to automatic review settings July 30, 2026 11:54
@gurpreet319
gurpreet319 requested a review from a team as a code owner July 30, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the JS runtime networking utilities to support integrating VIPA widget v1.4.4.5 with NativeScript, focusing on improving XMLHttpRequest behavior and expanding URLSearchParams compatibility.

Changes:

  • Refactors XMLHttpRequest.open()/send() to reset internal state more safely, parse URLs via the WHATWG URL API, and harden request/redirect handling.
  • Updates auth header creation to use Buffer.from and improves event dispatching to pass an event object to handlers/listeners.
  • Extends URLSearchParams construction to accept additional init shapes and adds iteration APIs (forEach, entries, keys, values).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
utils/xhr.js XHR state reset, URL parsing + request option construction, redirect handling, transport validation, and event dispatch behavior updates.
src/jsc/modules/lib/URLSearchParams.js Broader constructor input support and added iteration/utility methods (forEach/entries/keys/values).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/xhr.js
Comment thread utils/xhr.js
Comment thread utils/xhr.js
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/rdkNativeScript/138/rdkcentral/rdkNativeScript

  • Commit: 52de8a5

Report detail: gist'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/rdkNativeScript/138/rdkcentral/rdkNativeScript

  • Commit: 52de8a5

Report detail: gist'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## WARNING: A Blackduck scan failure has been waived

A prior failure has been upvoted

  • Upvote reason: OK - existing id was lost

  • Commit: 52de8a5
    '

Comment thread utils/xhr.js Outdated
Reason for change: Integrate VIPA 1.4.4.5 with nativescript, updated the xhr and URLSearchParams.
Test Procedure: build should be successful
Risk: low
Priority: P2
Copilot AI review requested due to automatic review settings August 7, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (2)

utils/xhr.js:405

  • Redirect handling reuses the original request headers and always ends the redirected request without re-sending the original body. This can produce incorrect redirects for non-GET requests (e.g., POST redirects sending Content-Length/Content-Type but no body), and 303 redirects should also switch the stored method to GET for any subsequent redirects.
            var redirectOptions = {
              hostname: redirectUrl.hostname,
              host: redirectUrl.hostname,
              port: redirectPort,
              path: redirectUrl.pathname + (redirectUrl.search || ""),
              protocol: redirectSsl ? "https:" : "http:",
              ssl: redirectSsl,
              method: response.statusCode === 303 ? "GET" : settings.method,
              headers: headers,
              withCredentials: self.withCredentials
            };

src/jsc/modules/lib/URLSearchParams.js:171

  • entries() currently returns the internal _list iterator, which exposes the backing tuple arrays to callers. That allows external mutation of tuples without triggering _updateSteps() and can desync URLSearchParams from its associated URL. Consider returning an iterator that yields copied [name, value] arrays instead.
  entries() {
    return this._list[Symbol.iterator]();
  }

@gurpreet319

Copy link
Copy Markdown
Contributor Author

Hi @mhughesacn, can you please review it

@gurpreet319
gurpreet319 requested a review from mhughesacn August 7, 2026 12:23
Copilot AI review requested due to automatic review settings August 7, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (3)

src/jsc/modules/lib/URLSearchParams.js:211

  • Symbol.iterator currently returns the internal _list iterator. Delegating to entries() keeps iteration semantics consistent across APIs and avoids exposing internal pair arrays.
  [Symbol.iterator]() {
    return this._list[Symbol.iterator]();
  }

utils/xhr.js:11

  • The header removed the original MIT license/attribution lines. Since this file is derived from third-party MIT-licensed code, the attribution/license notice should be retained for compliance.
 * Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs.
 * Original code by DeFelippi.
 * Some modifications by Comcast.
 *
 */

src/jsc/modules/lib/URLSearchParams.js:171

  • entries() currently returns the internal _list array iterator, which exposes the mutable internal pair arrays to callers (mutating an iterated pair would mutate URLSearchParams state). Returning an iterator that yields copied [name, value] pairs better matches platform behavior and avoids unexpected side effects.

This issue also appears on line 209 of the same file.

  entries() {
    return this._list[Symbol.iterator]();
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants